####################################################################################################

"""Common members of all bindings

This is where each member of Qt.py is explicitly defined.
It is based on a 'lowest common denominator' of all bindings;
including members found in each of the 4 bindings.

The '_common_members' dictionary is generated using the
build_membership.sh script.

"""

_common_members = {
    'QtCore': [
        'QAbstractAnimation',
        'QAbstractEventDispatcher',
        'QAbstractItemModel',
        'QAbstractListModel',
        'QAbstractState',
        'QAbstractTableModel',
        'QAbstractTransition',
        'QAnimationGroup',
        'QBasicTimer',
        'QBitArray',
        'QBuffer',
        'QByteArray',
        'QByteArrayMatcher',
        'QChildEvent',
        'QCoreApplication',
        'QCryptographicHash',
        'QDataStream',
        'QDate',
        'QDateTime',
        'QDir',
        'QDirIterator',
        'QDynamicPropertyChangeEvent',
        'QEasingCurve',
        'QElapsedTimer',
        'QEvent',
        'QEventLoop',
        'QEventTransition',
        'QFile',
        'QFileInfo',
        'QFileSystemWatcher',
        'QFinalState',
        'QGenericArgument',
        'QGenericReturnArgument',
        'QHistoryState',
        'QItemSelectionRange',
        'QIODevice',
        'QLibraryInfo',
        'QLine',
        'QLineF',
        'QLocale',
        'QMargins',
        'QMetaClassInfo',
        'QMetaEnum',
        'QMetaMethod',
        'QMetaObject',
        'QMetaProperty',
        'QMimeData',
        'QModelIndex',
        'QMutex',
        'QMutexLocker',
        'QObject',
        'QParallelAnimationGroup',
        'QPauseAnimation',
        'QPersistentModelIndex',
        'QPluginLoader',
        'QPoint',
        'QPointF',
        'QProcess',
        'QProcessEnvironment',
        'QPropertyAnimation',
        'QReadLocker',
        'QReadWriteLock',
        'QRect',
        'QRectF',
        'QRegExp',
        'QResource',
        'QRunnable',
        'QSemaphore',
        'QSequentialAnimationGroup',
        'QSettings',
        'QSignalMapper',
        'QSignalTransition',
        'QSize',
        'QSizeF',
        'QSocketNotifier',
        'QState',
        'QStateMachine',
        'QSysInfo',
        'QSystemSemaphore',
        'QT_TRANSLATE_NOOP',
        'QT_TR_NOOP',
        'QT_TR_NOOP_UTF8',
        'QTemporaryFile',
        'QTextBoundaryFinder',
        'QTextCodec',
        'QTextDecoder',
        'QTextEncoder',
        'QTextStream',
        'QTextStreamManipulator',
        'QThread',
        'QThreadPool',
        'QTime',
        'QTimeLine',
        'QTimer',
        'QTimerEvent',
        'QTranslator',
        'QUrl',
        'QVariantAnimation',
        'QWaitCondition',
        'QWriteLocker',
        'QXmlStreamAttribute',
        'QXmlStreamAttributes',
        'QXmlStreamEntityDeclaration',
        'QXmlStreamEntityResolver',
        'QXmlStreamNamespaceDeclaration',
        'QXmlStreamNotationDeclaration',
        'QXmlStreamReader',
        'QXmlStreamWriter',
        'Qt',
        'QtCriticalMsg',
        'QtDebugMsg',
        'QtFatalMsg',
        'QtMsgType',
        'QtSystemMsg',
        'QtWarningMsg',
        'qAbs',
        'qAddPostRoutine',
        'qChecksum',
        'qCritical',
        'qDebug',
        'qFatal',
        'qFuzzyCompare',
        'qIsFinite',
        'qIsInf',
        'qIsNaN',
        'qIsNull',
        'qRegisterResourceData',
        'qUnregisterResourceData',
        'qVersion',
        'qWarning',
        'qrand',
        'qsrand'
    ],
    'QtGui': [
        'QAbstractTextDocumentLayout',
        'QActionEvent',
        'QBitmap',
        'QBrush',
        'QClipboard',
        'QCloseEvent',
        'QColor',
        'QConicalGradient',
        'QContextMenuEvent',
        'QCursor',
        'QDesktopServices',
        'QDoubleValidator',
        'QDrag',
        'QDragEnterEvent',
        'QDragLeaveEvent',
        'QDragMoveEvent',
        'QDropEvent',
        'QFileOpenEvent',
        'QFocusEvent',
        'QFont',
        'QFontDatabase',
        'QFontInfo',
        'QFontMetrics',
        'QFontMetricsF',
        'QGradient',
        'QGuiApplication',
        'QHelpEvent',
        'QHideEvent',
        'QHoverEvent',
        'QIcon',
        'QIconDragEvent',
        'QIconEngine',
        'QImage',
        'QImageIOHandler',
        'QImageReader',
        'QImageWriter',
        'QInputEvent',
        'QInputMethodEvent',
        'QIntValidator',
        'QKeyEvent',
        'QKeySequence',
        'QLinearGradient',
        'QMatrix2x2',
        'QMatrix2x3',
        'QMatrix2x4',
        'QMatrix3x2',
        'QMatrix3x3',
        'QMatrix3x4',
        'QMatrix4x2',
        'QMatrix4x3',
        'QMatrix4x4',
        'QMouseEvent',
        'QMoveEvent',
        'QMovie',
        'QPaintDevice',
        'QPaintEngine',
        'QPaintEngineState',
        'QPaintEvent',
        'QPainter',
        'QPainterPath',
        'QPainterPathStroker',
        'QPalette',
        'QPen',
        'QPicture',
        'QPictureIO',
        'QPixmap',
        'QPixmapCache',
        'QPolygon',
        'QPolygonF',
        'QQuaternion',
        'QRadialGradient',
        'QRegExpValidator',
        'QRegion',
        'QResizeEvent',
        'QSessionManager',
        'QShortcutEvent',
        'QShowEvent',
        'QStandardItem',
        'QStandardItemModel',
        'QStatusTipEvent',
        'QSyntaxHighlighter',
        'QTabletEvent',
        'QTextBlock',
        'QTextBlockFormat',
        'QTextBlockGroup',
        'QTextBlockUserData',
        'QTextCharFormat',
        'QTextCursor',
        'QTextDocument',
        'QTextDocumentFragment',
        'QTextFormat',
        'QTextFragment',
        'QTextFrame',
        'QTextFrameFormat',
        'QTextImageFormat',
        'QTextInlineObject',
        'QTextItem',
        'QTextLayout',
        'QTextLength',
        'QTextLine',
        'QTextList',
        'QTextListFormat',
        'QTextObject',
        'QTextObjectInterface',
        'QTextOption',
        'QTextTable',
        'QTextTableCell',
        'QTextTableCellFormat',
        'QTextTableFormat',
        'QTouchEvent',
        'QTransform',
        'QValidator',
        'QVector2D',
        'QVector3D',
        'QVector4D',
        'QWhatsThisClickedEvent',
        'QWheelEvent',
        'QWindowStateChangeEvent',
        'qAlpha',
        'qBlue',
        'qGray',
        'qGreen',
        'qIsGray',
        'qRed',
        'qRgb',
        'qRgba'
    ],
    # 'QtHelp': [
    #     'QHelpContentItem',
    #     'QHelpContentModel',
    #     'QHelpContentWidget',
    #     'QHelpEngine',
    #     'QHelpEngineCore',
    #     'QHelpIndexModel',
    #     'QHelpIndexWidget',
    #     'QHelpSearchEngine',
    #     'QHelpSearchQuery',
    #     'QHelpSearchQueryWidget',
    #     'QHelpSearchResultWidget'
    # ],
    # 'QtMultimedia': [
    #     'QAbstractVideoBuffer',
    #     'QAbstractVideoSurface',
    #     'QAudio',
    #     'QAudioDeviceInfo',
    #     'QAudioFormat',
    #     'QAudioInput',
    #     'QAudioOutput',
    #     'QVideoFrame',
    #     'QVideoSurfaceFormat'
    # ],
    # 'QtNetwork': [
    #     'QAbstractNetworkCache',
    #     'QAbstractSocket',
    #     'QAuthenticator',
    #     'QHostAddress',
    #     'QHostInfo',
    #     'QLocalServer',
    #     'QLocalSocket',
    #     'QNetworkAccessManager',
    #     'QNetworkAddressEntry',
    #     'QNetworkCacheMetaData',
    #     'QNetworkConfiguration',
    #     'QNetworkConfigurationManager',
    #     'QNetworkCookie',
    #     'QNetworkCookieJar',
    #     'QNetworkDiskCache',
    #     'QNetworkInterface',
    #     'QNetworkProxy',
    #     'QNetworkProxyFactory',
    #     'QNetworkProxyQuery',
    #     'QNetworkReply',
    #     'QNetworkRequest',
    #     'QNetworkSession',
    #     'QSsl',
    #     'QTcpServer',
    #     'QTcpSocket',
    #     'QUdpSocket'
    # ],
    # 'QtOpenGL': [
    #     'QGL',
    #     'QGLContext',
    #     'QGLFormat',
    #     'QGLWidget'
    # ],
    # 'QtPrintSupport': [
    #     'QAbstractPrintDialog',
    #     'QPageSetupDialog',
    #     'QPrintDialog',
    #     'QPrintEngine',
    #     'QPrintPreviewDialog',
    #     'QPrintPreviewWidget',
    #     'QPrinter',
    #     'QPrinterInfo'
    # ],
    # 'QtSql': [
    #     'QSql',
    #     'QSqlDatabase',
    #     'QSqlDriver',
    #     'QSqlDriverCreatorBase',
    #     'QSqlError',
    #     'QSqlField',
    #     'QSqlIndex',
    #     'QSqlQuery',
    #     'QSqlQueryModel',
    #     'QSqlRecord',
    #     'QSqlRelation',
    #     'QSqlRelationalDelegate',
    #     'QSqlRelationalTableModel',
    #     'QSqlResult',
    #     'QSqlTableModel'
    # ],
    'QtSvg': [
        'QGraphicsSvgItem',
        'QSvgGenerator',
        'QSvgRenderer',
        'QSvgWidget'
    ],
    # 'QtTest': [
    #     'QTest'
    # ],
    'QtWidgets': [
        'QAbstractButton',
        'QAbstractGraphicsShapeItem',
        'QAbstractItemDelegate',
        'QAbstractItemView',
        'QAbstractScrollArea',
        'QAbstractSlider',
        'QAbstractSpinBox',
        'QAction',
        'QActionGroup',
        'QApplication',
        'QBoxLayout',
        'QButtonGroup',
        'QCalendarWidget',
        'QCheckBox',
        'QColorDialog',
        'QColumnView',
        'QComboBox',
        'QCommandLinkButton',
        'QCommonStyle',
        'QCompleter',
        'QDataWidgetMapper',
        'QDateEdit',
        'QDateTimeEdit',
        'QDesktopWidget',
        'QDial',
        'QDialog',
        'QDialogButtonBox',
        'QDirModel',
        'QDockWidget',
        'QDoubleSpinBox',
        'QErrorMessage',
        'QFileDialog',
        'QFileIconProvider',
        'QFileSystemModel',
        'QFocusFrame',
        'QFontComboBox',
        'QFontDialog',
        'QFormLayout',
        'QFrame',
        'QGesture',
        'QGestureEvent',
        'QGestureRecognizer',
        'QGraphicsAnchor',
        'QGraphicsAnchorLayout',
        'QGraphicsBlurEffect',
        'QGraphicsColorizeEffect',
        'QGraphicsDropShadowEffect',
        'QGraphicsEffect',
        'QGraphicsEllipseItem',
        'QGraphicsGridLayout',
        'QGraphicsItem',
        'QGraphicsItemGroup',
        'QGraphicsLayout',
        'QGraphicsLayoutItem',
        'QGraphicsLineItem',
        'QGraphicsLinearLayout',
        'QGraphicsObject',
        'QGraphicsOpacityEffect',
        'QGraphicsPathItem',
        'QGraphicsPixmapItem',
        'QGraphicsPolygonItem',
        'QGraphicsProxyWidget',
        'QGraphicsRectItem',
        'QGraphicsRotation',
        'QGraphicsScale',
        'QGraphicsScene',
        'QGraphicsSceneContextMenuEvent',
        'QGraphicsSceneDragDropEvent',
        'QGraphicsSceneEvent',
        'QGraphicsSceneHelpEvent',
        'QGraphicsSceneHoverEvent',
        'QGraphicsSceneMouseEvent',
        'QGraphicsSceneMoveEvent',
        'QGraphicsSceneResizeEvent',
        'QGraphicsSceneWheelEvent',
        'QGraphicsSimpleTextItem',
        'QGraphicsTextItem',
        'QGraphicsTransform',
        'QGraphicsView',
        'QGraphicsWidget',
        'QGridLayout',
        'QGroupBox',
        'QHBoxLayout',
        'QHeaderView',
        'QInputDialog',
        'QItemDelegate',
        'QItemEditorCreatorBase',
        'QItemEditorFactory',
        'QKeyEventTransition',
        'QLCDNumber',
        'QLabel',
        'QLayout',
        'QLayoutItem',
        'QLineEdit',
        'QListView',
        'QListWidget',
        'QListWidgetItem',
        'QMainWindow',
        'QMdiArea',
        'QMdiSubWindow',
        'QMenu',
        'QMenuBar',
        'QMessageBox',
        'QMouseEventTransition',
        'QPanGesture',
        'QPinchGesture',
        'QPlainTextDocumentLayout',
        'QPlainTextEdit',
        'QProgressBar',
        'QProgressDialog',
        'QPushButton',
        'QRadioButton',
        'QRubberBand',
        'QScrollArea',
        'QScrollBar',
        'QShortcut',
        'QSizeGrip',
        'QSizePolicy',
        'QSlider',
        'QSpacerItem',
        'QSpinBox',
        'QSplashScreen',
        'QSplitter',
        'QSplitterHandle',
        'QStackedLayout',
        'QStackedWidget',
        'QStatusBar',
        'QStyle',
        'QStyleFactory',
        'QStyleHintReturn',
        'QStyleHintReturnMask',
        'QStyleHintReturnVariant',
        'QStyleOption',
        'QStyleOptionButton',
        'QStyleOptionComboBox',
        'QStyleOptionComplex',
        'QStyleOptionDockWidget',
        'QStyleOptionFocusRect',
        'QStyleOptionFrame',
        'QStyleOptionGraphicsItem',
        'QStyleOptionGroupBox',
        'QStyleOptionHeader',
        'QStyleOptionMenuItem',
        'QStyleOptionProgressBar',
        'QStyleOptionRubberBand',
        'QStyleOptionSizeGrip',
        'QStyleOptionSlider',
        'QStyleOptionSpinBox',
        'QStyleOptionTab',
        'QStyleOptionTabBarBase',
        'QStyleOptionTabWidgetFrame',
        'QStyleOptionTitleBar',
        'QStyleOptionToolBar',
        'QStyleOptionToolBox',
        'QStyleOptionToolButton',
        'QStyleOptionViewItem',
        'QStylePainter',
        'QStyledItemDelegate',
        'QSwipeGesture',
        'QSystemTrayIcon',
        'QTabBar',
        'QTabWidget',
        'QTableView',
        'QTableWidget',
        'QTableWidgetItem',
        'QTableWidgetSelectionRange',
        'QTapAndHoldGesture',
        'QTapGesture',
        'QTextBrowser',
        'QTextEdit',
        'QTimeEdit',
        'QToolBar',
        'QToolBox',
        'QToolButton',
        'QToolTip',
        'QTreeView',
        'QTreeWidget',
        'QTreeWidgetItem',
        'QTreeWidgetItemIterator',
        'QUndoCommand',
        'QUndoGroup',
        'QUndoStack',
        'QUndoView',
        'QVBoxLayout',
        'QWhatsThis',
        'QWidget',
        'QWidgetAction',
        'QWidgetItem',
        'QWizard',
        'QWizardPage'
    ],
    # 'QtX11Extras': [
    #     'QX11Info'
    # ],
    # 'QtXml': [
    #     'QDomAttr',
    #     'QDomCDATASection',
    #     'QDomCharacterData',
    #     'QDomComment',
    #     'QDomDocument',
    #     'QDomDocumentFragment',
    #     'QDomDocumentType',
    #     'QDomElement',
    #     'QDomEntity',
    #     'QDomEntityReference',
    #     'QDomImplementation',
    #     'QDomNamedNodeMap',
    #     'QDomNode',
    #     'QDomNodeList',
    #     'QDomNotation',
    #     'QDomProcessingInstruction',
    #     'QDomText',
    #     'QXmlAttributes',
    #     'QXmlContentHandler',
    #     'QXmlDTDHandler',
    #     'QXmlDeclHandler',
    #     'QXmlDefaultHandler',
    #     'QXmlEntityResolver',
    #     'QXmlErrorHandler',
    #     'QXmlInputSource',
    #     'QXmlLexicalHandler',
    #     'QXmlLocator',
    #     'QXmlNamespaceSupport',
    #     'QXmlParseException',
    #     'QXmlReader',
    #     'QXmlSimpleReader'
    # ],
    # 'QtXmlPatterns': [
    #     'QAbstractMessageHandler',
    #     'QAbstractUriResolver',
    #     'QAbstractXmlNodeModel',
    #     'QAbstractXmlReceiver',
    #     'QSourceLocation',
    #     'QXmlFormatter',
    #     'QXmlItem',
    #     'QXmlName',
    #     'QXmlNamePool',
    #     'QXmlNodeModelIndex',
    #     'QXmlQuery',
    #     'QXmlResultItems',
    #     'QXmlSchema',
    #     'QXmlSchemaValidator',
    #     'QXmlSerializer'
    # ]
    'QtQml': [
        'qmlRegisterType',
        'qmlRegisterUncreatableType',
        'QQmlApplicationEngine',
    ],
    'QtQuick': [
        'QQuickPaintedItem',
        'QQuickView',
    ],
}

####################################################################################################

"""Misplaced members

These members from the original submodule are misplaced relative PySide2

"""

_misplaced_members = {
    'PySide2': {
        'QtCore.QStringListModel': 'QtCore.QStringListModel',
        'QtGui.QStringListModel': 'QtCore.QStringListModel',
        'QtCore.Property': 'QtCore.Property',
        'QtCore.Signal': 'QtCore.Signal',
        'QtCore.Slot': 'QtCore.Slot',
        'QtCore.QAbstractProxyModel': 'QtCore.QAbstractProxyModel',
        'QtCore.QSortFilterProxyModel': 'QtCore.QSortFilterProxyModel',
        'QtCore.QItemSelection': 'QtCore.QItemSelection',
        'QtCore.QItemSelectionModel': 'QtCore.QItemSelectionModel',
        'QtCore.QItemSelectionRange': 'QtCore.QItemSelectionRange',
        # 'QtUiTools.QUiLoader': ['QtCompat.loadUi', _loadUi],
        # 'shiboken2.wrapInstance': ['QtCompat.wrapInstance', _wrapinstance],
        # 'shiboken2.getCppPointer': ['QtCompat.getCppPointer', _getcpppointer],
        'QtWidgets.qApp': 'QtWidgets.QApplication.instance()',
        # 'QtCore.QCoreApplication.translate': [
        #     'QtCompat.translate', _translate
        # ],
        # 'QtWidgets.QApplication.translate': [
        #     'QtCompat.translate', _translate
        # ],
        # 'QtCore.qInstallMessageHandler': [
        #     'QtCompat.qInstallMessageHandler', _qInstallMessageHandler
        # ],
    },
    'PyQt5': {
        'QtCore.pyqtProperty': 'QtCore.Property',
        'QtCore.pyqtSignal': 'QtCore.Signal',
        'QtCore.pyqtSlot': 'QtCore.Slot',
        'QtCore.QAbstractProxyModel': 'QtCore.QAbstractProxyModel',
        'QtCore.QSortFilterProxyModel': 'QtCore.QSortFilterProxyModel',
        'QtCore.QStringListModel': 'QtCore.QStringListModel',
        'QtCore.QItemSelection': 'QtCore.QItemSelection',
        'QtCore.QItemSelectionModel': 'QtCore.QItemSelectionModel',
        'QtCore.QItemSelectionRange': 'QtCore.QItemSelectionRange',
        # 'uic.loadUi': ['QtCompat.loadUi', _loadUi],
        # 'sip.wrapinstance': ['QtCompat.wrapInstance', _wrapinstance],
        # 'sip.unwrapinstance': ['QtCompat.getCppPointer', _getcpppointer],
        'QtWidgets.qApp': 'QtWidgets.QApplication.instance()',
        # 'QtCore.QCoreApplication.translate': [
        #     'QtCompat.translate', _translate
        # ],
        # 'QtWidgets.QApplication.translate': [
        #     'QtCompat.translate', _translate
        # ],
        # 'QtCore.qInstallMessageHandler': [
        #     'QtCompat.qInstallMessageHandler', _qInstallMessageHandler
        # ],
    },
}

####################################################################################################

"""Compatibility Members

This dictionary is used to build Qt.QtCompat objects that provide a consistent
interface for obsolete members, and differences in binding return values.

{
    'binding': {
        'classname': {
            'targetname': 'binding_namespace',
        }
    }
}

"""

_compatibility_members = {
    'PySide2': {
        # 'QWidget': {
        #     'grab': 'QtWidgets.QWidget.grab',
        # },
        # 'QHeaderView': {
        #     'sectionsClickable': 'QtWidgets.QHeaderView.sectionsClickable',
        #     'setSectionsClickable':
        #         'QtWidgets.QHeaderView.setSectionsClickable',
        #     'sectionResizeMode': 'QtWidgets.QHeaderView.sectionResizeMode',
        #     'setSectionResizeMode':
        #         'QtWidgets.QHeaderView.setSectionResizeMode',
        #     'sectionsMovable': 'QtWidgets.QHeaderView.sectionsMovable',
        #     'setSectionsMovable': 'QtWidgets.QHeaderView.setSectionsMovable',
        # },
        # 'QFileDialog': {
        #     'getOpenFileName': 'QtWidgets.QFileDialog.getOpenFileName',
        #     'getOpenFileNames': 'QtWidgets.QFileDialog.getOpenFileNames',
        #     'getSaveFileName': 'QtWidgets.QFileDialog.getSaveFileName',
        # },
    },
    'PyQt5': {
        # 'QWidget': {
        #     'grab': 'QtWidgets.QWidget.grab',
        # },
        # 'QHeaderView': {
        #     'sectionsClickable': 'QtWidgets.QHeaderView.sectionsClickable',
        #     'setSectionsClickable':
        #         'QtWidgets.QHeaderView.setSectionsClickable',
        #     'sectionResizeMode': 'QtWidgets.QHeaderView.sectionResizeMode',
        #     'setSectionResizeMode':
        #         'QtWidgets.QHeaderView.setSectionResizeMode',
        #     'sectionsMovable': 'QtWidgets.QHeaderView.sectionsMovable',
        #     'setSectionsMovable': 'QtWidgets.QHeaderView.setSectionsMovable',
        # },
        # 'QFileDialog': {
        #     'getOpenFileName': 'QtWidgets.QFileDialog.getOpenFileName',
        #     'getOpenFileNames': 'QtWidgets.QFileDialog.getOpenFileNames',
        #     'getSaveFileName': 'QtWidgets.QFileDialog.getSaveFileName',
        # },
    },
}
